package cn.change360.newappchildrenenglish;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    TextView btn1, btn2, btn3, btn4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
    }

    private void initView() {
        btn1 = (TextView) findViewById(R.id.btn1);
        btn2 = (TextView) findViewById(R.id.btn2);
        btn3 = (TextView) findViewById(R.id.btn3);
        btn4 = (TextView) findViewById(R.id.btn4);

        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
        btn4.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.btn1:
                intent = new Intent(this, LetterActivity.class);
                startActivity(intent);
                break;
            case R.id.btn2:
                intent = new Intent(this, WordsActivity.class);
                startActivity(intent);
                break;
            case R.id.btn3:
                intent = new Intent(this, CharactersActivity.class);
                startActivity(intent);
                break;
            case R.id.btn4:
                intent = new Intent(this, DictationActivity.class);
                startActivity(intent);
                break;
        }
    }
}
